//package com.anmingle.pswb.config;
//
//import org.springframework.boot.system.ApplicationHome;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//import java.io.File;
//
///**
// * @author anmingle
// * @date 2022/5/16 20:01
// */
//@Configuration
//public class MyWebAppConfigurer implements WebMvcConfigurer {
//
//    /**上传地址*/
//    ApplicationHome h = new ApplicationHome(getClass());
//    File p = h.getSource();
//    //设置储存地址
//
//    String path = p.getParentFile().toString()+"/user/";
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        //mvc 上传图片映射
//        registry.addResourceHandler("/image///**").addResourceLocations("file:"+path);
//        //访问项目外的资源映射
//        WebMvcConfigurer.super.addResourceHandlers(registry);
//    }
//}
